package smlab.media
{
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.net.SharedObject;
	import flash.system.ApplicationDomain;
	
	import smlab.media.FLVPlayer.CoreGlobal;
	import smlab.media.FLVPlayer.view.StateContainer;

	/**
	 * 嘟嘟 视频播放器 主入口
	 * @author simon
	 * 
	 */
	[SWF(width=480,height=398,frameRate=24,backgroundColor=0)]
	public class FLVPlayer extends Sprite
	{
		public function FLVPlayer()
		{
			stage.align=StageAlign.TOP_LEFT;
			stage.scaleMode=StageScaleMode.NO_SCALE;
			
			CoreGlobal.stage=stage;
			CoreGlobal.appDomain=ApplicationDomain.currentDomain;
			CoreGlobal.videoWidth=stage.stageWidth;
			CoreGlobal.videoHeight=stage.stageWidth/(4/3);
			CoreGlobal.shareObj=SharedObject.getLocal("DuDuVideoSetting");
			if(CoreGlobal.shareObj.data.volume==null){
				CoreGlobal.shareObj.data.volume=0.7;
			}
			CoreGlobal.playerSkinURL=CoreGlobal.stage.loaderInfo.parameters['skinurl'];
			trace("皮肤地址："+CoreGlobal.stage.loaderInfo.parameters['skinurl']);
			CoreGlobal.currentVideoURL=CoreGlobal.stage.loaderInfo.parameters['file'];
			trace("视频地址："+CoreGlobal.stage.loaderInfo.parameters['file']);
			CoreGlobal.currentVideoTotalTime=CoreGlobal.stage.loaderInfo.parameters['totalTime'];
			trace("视频总时长："+CoreGlobal.stage.loaderInfo.parameters['totalTime']);
			addChild(StateContainer.getInstance());
		}
	}
}
